package com.ddone.code.executor.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author ddone
 * @date 2024/8/10-20:32
 */
@RestController
public class HiveTestController {

    @Autowired
    @Qualifier("hiveJdbcTemplate")
    private JdbcTemplate hiveJdbcTemplate;
    @GetMapping("/hive")
    public List<Map<String, Object>> test(){
        return hiveJdbcTemplate.queryForList("select\n" +
                "    *\n" +
                "from ip_china\n" +
                "limit 10");
    }
}
